package javabean;

public class User {
    //1、成员变量建议使用private私有
    private String name;
    private double height;
    private double salary;

    public User() {
    }

    /**
     3、要求提供无参数构造器，有参数构造器是可选
     */

    public User(String name, double height, double salary) {
        this.name = name;
        this.height = height;
        this.salary = salary;
    }
    public void test1(){
        int a = 10;
        test(a); // b = a
        double[] c = new double[]{1,3};
        test(c);  // c=>t
        c[0]=1;
    }
    public void test(double[] t) {
        t[1] =1;
    }

    public void test(int b){
    }
    /**
     2、必须为成员变量提供成套的setter和gettter方法
     */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}
